import request from '@/utils/myrequest'

export function getTreeList(kvs) {
  return request({
    url: '/config/LayoutStructure/GetTree',
    method: 'get',
    kvs
  })
}

// 获取只有子节点
export function getTreeChildList(kvs) {
  return request({
    url: '/config/LayoutStructure/GetLastNodes',
    method: 'get',
    kvs
  })
}

export function getChildList(kvs) {
  return request({
    url: '/config/LayoutStructure/GetList',
    method: 'get',
    kvs
  })
}

// 添加根节点
export function doAddNode(kvs) {
  return request({
    url: '/config/LayoutStructure/AddNode',
    method: 'POST',
    kvs
  })
}

export function doDelete(kvs) {
  return request({
    url: '/config/LayoutStructure/Delete',
    method: 'POST',
    kvs
  })
}

export function doUpdate(kvs) {
  return request({
    url: '/config/LayoutStructure/Update',
    method: 'POST',
    kvs
  })
}

export function getChildTree(kvs) {
  return request({
    url: '/config/LayoutStructure/GetTree',
    method: 'get',
    kvs
  })
}
